
#ifndef TOPO_ARROW_H
#define TOPO_ARROW_H

#include <QGraphicsLineItem>
#include <QCursor>
#include "topoNodeItem.h"
#include "deviceconnect.h"
#include "topoConstDef.h"
QT_BEGIN_NAMESPACE
class QGraphicsPolygonItem;
class QGraphicsLineItem;
class QGraphicsScene;
class QRectF;
class QGraphicsSceneMouseEvent;
class QPainterPath;
QT_END_NAMESPACE
//! [0]
class TopoConnection : public QGraphicsLineItem
{
public:

    TopoConnection(Deviceconnect *conn, QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    QRectF boundingRect() const;
	//QRegion boundingRegion ( const QTransform & itemToDeviceTransform ) const;
    QPainterPath shape() const;
    /*void setColor(const QColor &color)
    {
        myColor = color;
    } */
    //qreal verticalPos() const
    //{return m_VerticalPos;}
    void setConnPoints();
    void setRemoveFlag(bool bRemoved)
    {
        m_bRemoved = bRemoved;
    }
    Deviceconnect *getConnection() const
    {
        return m_connItem;
    }
public slots:
    void updatePosition();

protected:
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
               QWidget *widget = 0);
private:
    void setConnLine();
    TopoNodeItem *m_startItem;
    TopoNodeItem *m_endItem;
    Deviceconnect *m_connItem;
    //QColor myColor;
    int m_nCountLevel;
    QRectF m_boundingRect;
    bool    m_bRemoved;
    bool m_bIsEpon;
    bool m_bIsDoubleSub;
};
//! [0]

#endif
